package com.example.tt_bells_v02;

public class BellInfo {
	//actions masks
	static final int BELL_ACTION_TOAST 		= 0x01;
	static final int BELL_ACTION_NOTIFY 	= 0x02;
	static final int BELL_ACTION_CONFIRM 	= 0x04;
	static final int BELL_ACTION_SOUND 		= 0x08;
	static final int BELL_ACTION_LOG 		= 0x10;
	static final int BELL_ACTION_NAVAL		= 0x20; //Incrementing bells like ship watch-glass
	//bell types
	static final int BELL_TYPE_SINGLE 		= 0;
	static final int BELL_TYPE_PERIODIC 	= 1;
	static final int BELL_TYPE_MULTIPLE 	= 2;
	static final int BELL_TYPE_RANDOM		= 3; //Don't sure it's really needed
	//edit flags
	static final int EDIT_TEMPLATE 			= 0;
	static final int EDIT_BELL 				= 1;
	static final int EDIT_DAY				= 2;
	static final int EDIT_MONTH				= 3;
	
	int			id;
	int			bell_type;
	int			bell_actions;
	
	String		name_short;
	String 		name_long;
	String 		alarm_message;

	//indexes of icon and sound files (or maybe store a path?)
	int					icon_index;
	int					sound_index;

	int					periods_count;
	int					period_size; //HM-packed	
	
	public int getHour(int packed_daytime) {
		return ((packed_daytime >>> 8) & 0xFF);
	}
	
	public int getMinute(int packed_daytime) {
		return (packed_daytime & 0xFF);
	}
	
	public int setHM(int hours, int minutes) {
		return (((hours << 8) & 0xFF00) | (minutes & 0xFF));
	}
	
}
